package view.panel.fast
{
	import control.panel.FastReplayPanelControl;
	
	import flash.events.MouseEvent;
	
	import view.components.UIComponents;
	import view.panel.AbsPanel;
	
	public class FastReplyPanel extends AbsPanel
	{
		private var list:*;
		
		public function FastReplyPanel(panelControl:FastReplayPanelControl)
		{
			super(panelControl);
			defaultX = 585;
			defaultY = 220;
			resetBg(140,218,0);
			//initTweenPanelOpen();
			initList();
			initListener();
		}
		
		private function initList():void
		{
			list = UIComponents.getList(140,218);
			list.bgAlpha = .5;
			list.addEventListener("itemClick",onItemClick);
			addChild(list);
		}
		
		private function onItemClick(event:*):void
		{
			(panelControl as FastReplayPanelControl).onItemClick(event.item.label);
			
		}
		
		public function addItem(item:Object):void
		{
			list.addItem(item);
			
		}
		
		override public function open() : void
		{
			super.open();
			list.selectedItem = null;
		}
		
		private function initListener():void
		{
			this.addEventListener(MouseEvent.ROLL_OUT,onRollOut);
		}
		
		private function onRollOut(event:MouseEvent):void
		{
			close();
		}
	}
}